Repository navigation
[api-major] Compress the binary CMap files with Brotli - #22513
Conversation
Reference testsResults for 255be26 (run, references from mozilla/pdf.js.refs@15d1c1caf7).
The report is kept for 30 days and replaced by the next run. |
255be26 to
03c7279
Compare
Viewer preview🗑️ Viewer previews removed. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #22513 +/- ##
==========================================
- Coverage 90.56% 90.38% -0.18%
==========================================
Files 276 276
Lines 68676 69898 +1222
==========================================
+ Hits 62193 63177 +984
- Misses 6483 6721 +238
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
03c7279 to
9d467dc
Compare
Merging this PR will degrade performance by 10.69%1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
While the binary CMap format is fairly efficient already, by also compressing them maximally with Brotli we can reduce their size even further. The decompression is done on load in the worker-thread, and thanks to the existing caching it only needs to happen *once* per file. By utilizing the `BrotliStream` class all builds/environments can use these smaller files, and in e.g. Firefox (which supports native decompression) even the largest binary CMap files are decompressed in *under* `1` millisecond. *Note:* This reduces the size of the `gulp mozcentral` bundle by `320076` bytes, i.e. over 312 kilo-bytes.
9d467dc to
06e4ecb
Compare
|
Good idea; thank you for implementing this! |
While the binary CMap format is fairly efficient already, by also compressing them maximally with Brotli we can reduce their size even further.
The decompression is done on load in the worker-thread, and thanks to the existing caching it only needs to happen once per file. By utilizing the
BrotliStreamclass all builds/environments can use these smaller files, and in e.g. Firefox (which supports native decompression) even the largest binary CMap files are decompressed in under1millisecond.Note: This reduces the size of the
gulp mozcentralbundle by320076bytes, i.e. over 312 kilo-bytes.